import request from '@/utils/request'

// 根据字典类型查询字典数据
export function getDicts(dictType) {
  return request({
    url: '/system/dict/data/' + dictType,
    method: 'get'
  })
}

// 获取字典数据列表
export function getList(query) {
  return request({
    url: '/system/dict/data/',
    method: 'get',
    params: query
  })
}

// 根据ID获取数据
export function getData(id) {
  return request({
    url: '/system/dict/data/getData/' + id,
    method: 'get'
  })
}

// 修改字典数据根据ID
export function updateData(data) {
  return request({
    url: "/system/dict/data",
    method: "put",
    data: data
  })
}

// 添加字典
export function addData(data) {
  return request({
    url: "/system/dict/data",
    method: "post",
    data: data
  })
}

// 删除字典数据
export function delDatas(ids) {
  return request({
    url: "/system/dict/data/" + ids,
    method: "delete",
  })
}
